package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * StudentResit generated by hbm2java
 */
@Entity
@Table(name = "student_resit")
public class StudentResit implements java.io.Serializable {

	private Long id;
	private MainPoint mainPoint;
	private MainPointModule mainPointModule;
	private Topic topic;
	private UserBaseInfo userBaseInfoByDirectorId;
	private UserBaseInfo userBaseInfoByStudentId;
	private Integer studyNum;
	private Date makeTime;
	private boolean publishState;
	private byte resitState;
	private byte resitType;
	private Integer totalTime;
	private Set<StudentRecommend> studentRecommends = new HashSet<StudentRecommend>(
			0);
	private Set<StudentResitDetail> studentResitDetails = new HashSet<StudentResitDetail>(
			0);
	private Set<TrainPlan> trainPlans = new HashSet<TrainPlan>(0);

	public StudentResit() {
	}

	public StudentResit(Topic topic, UserBaseInfo userBaseInfoByDirectorId,
			UserBaseInfo userBaseInfoByStudentId, Date makeTime,
			boolean publishState, byte resitState, byte resitType) {
		this.topic = topic;
		this.userBaseInfoByDirectorId = userBaseInfoByDirectorId;
		this.userBaseInfoByStudentId = userBaseInfoByStudentId;
		this.makeTime = makeTime;
		this.publishState = publishState;
		this.resitState = resitState;
		this.resitType = resitType;
	}

	public StudentResit(MainPoint mainPoint, MainPointModule mainPointModule,
			Topic topic, UserBaseInfo userBaseInfoByDirectorId,
			UserBaseInfo userBaseInfoByStudentId, Integer studyNum,
			Date makeTime, boolean publishState, byte resitState,
			byte resitType, Integer totalTime,
			Set<StudentRecommend> studentRecommends,
			Set<StudentResitDetail> studentResitDetails,
			Set<TrainPlan> trainPlans) {
		this.mainPoint = mainPoint;
		this.mainPointModule = mainPointModule;
		this.topic = topic;
		this.userBaseInfoByDirectorId = userBaseInfoByDirectorId;
		this.userBaseInfoByStudentId = userBaseInfoByStudentId;
		this.studyNum = studyNum;
		this.makeTime = makeTime;
		this.publishState = publishState;
		this.resitState = resitState;
		this.resitType = resitType;
		this.totalTime = totalTime;
		this.studentRecommends = studentRecommends;
		this.studentResitDetails = studentResitDetails;
		this.trainPlans = trainPlans;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MAIN_POINT_ID")
	public MainPoint getMainPoint() {
		return this.mainPoint;
	}

	public void setMainPoint(MainPoint mainPoint) {
		this.mainPoint = mainPoint;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MAIN_POINT_MODULE_ID")
	public MainPointModule getMainPointModule() {
		return this.mainPointModule;
	}

	public void setMainPointModule(MainPointModule mainPointModule) {
		this.mainPointModule = mainPointModule;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TOPIC_ID", nullable = false)
	public Topic getTopic() {
		return this.topic;
	}

	public void setTopic(Topic topic) {
		this.topic = topic;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DIRECTOR_ID", nullable = false)
	public UserBaseInfo getUserBaseInfoByDirectorId() {
		return this.userBaseInfoByDirectorId;
	}

	public void setUserBaseInfoByDirectorId(
			UserBaseInfo userBaseInfoByDirectorId) {
		this.userBaseInfoByDirectorId = userBaseInfoByDirectorId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STUDENT_ID", nullable = false)
	public UserBaseInfo getUserBaseInfoByStudentId() {
		return this.userBaseInfoByStudentId;
	}

	public void setUserBaseInfoByStudentId(UserBaseInfo userBaseInfoByStudentId) {
		this.userBaseInfoByStudentId = userBaseInfoByStudentId;
	}

	@Column(name = "STUDY_NUM")
	public Integer getStudyNum() {
		return this.studyNum;
	}

	public void setStudyNum(Integer studyNum) {
		this.studyNum = studyNum;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "MAKE_TIME", nullable = false, length = 19)
	public Date getMakeTime() {
		return this.makeTime;
	}

	public void setMakeTime(Date makeTime) {
		this.makeTime = makeTime;
	}

	@Column(name = "PUBLISH_STATE", nullable = false)
	public boolean isPublishState() {
		return this.publishState;
	}

	public void setPublishState(boolean publishState) {
		this.publishState = publishState;
	}

	@Column(name = "RESIT_STATE", nullable = false)
	public byte getResitState() {
		return this.resitState;
	}

	public void setResitState(byte resitState) {
		this.resitState = resitState;
	}

	@Column(name = "RESIT_TYPE", nullable = false)
	public byte getResitType() {
		return this.resitType;
	}

	public void setResitType(byte resitType) {
		this.resitType = resitType;
	}

	@Column(name = "TOTAL_TIME")
	public Integer getTotalTime() {
		return this.totalTime;
	}

	public void setTotalTime(Integer totalTime) {
		this.totalTime = totalTime;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "studentResit")
	public Set<StudentRecommend> getStudentRecommends() {
		return this.studentRecommends;
	}

	public void setStudentRecommends(Set<StudentRecommend> studentRecommends) {
		this.studentRecommends = studentRecommends;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "studentResit")
	public Set<StudentResitDetail> getStudentResitDetails() {
		return this.studentResitDetails;
	}

	public void setStudentResitDetails(
			Set<StudentResitDetail> studentResitDetails) {
		this.studentResitDetails = studentResitDetails;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "studentResit")
	public Set<TrainPlan> getTrainPlans() {
		return this.trainPlans;
	}

	public void setTrainPlans(Set<TrainPlan> trainPlans) {
		this.trainPlans = trainPlans;
	}

}
